package com.demo.common;

import com.demo.index.IndexContoller;
import com.demo.my.MyController;
import com.demo.my.RamController;
import com.demo.my.RenderHtmlController;
import com.demo.my.UeHtmlController;
import com.demo.ue.UeditorServerController;
import com.jfinal.config.Constants;
import com.jfinal.config.Handlers;
import com.jfinal.config.Interceptors;
import com.jfinal.config.JFinalConfig;
import com.jfinal.config.Plugins;
import com.jfinal.config.Routes;
import com.jfinal.kit.PropKit;
import com.jfinal.render.ViewType;

public class DemoConfig extends JFinalConfig {

	@Override
	public void configConstant(Constants me) {
		PropKit.use("config.properties");
		me.setDevMode(PropKit.getBoolean("devMode", false));
		
		// 默认使用freemarker, 如果不导入freemarker的jar包,要手动设置viewtype
		me.setViewType(ViewType.JSP);
	}

	@Override
	public void configRoute(Routes me) {
//		me.add("/", IndexContoller.class, "/index");
		me.add("/", IndexContoller.class);
		me.add("/ue", UeditorServerController.class);
		me.add("/my", MyController.class);
		me.add("/rhc", RenderHtmlController.class);
		me.add("/uehtml", UeHtmlController.class);
		me.add("/ram", RamController.class);
	}
	
	@Override
	public void configHandler(Handlers arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void configInterceptor(Interceptors arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void configPlugin(Plugins arg0) {
		// TODO Auto-generated method stub

	}

	

}
